#ifndef DESIGN_PATTERNS_FACTORY_METHOD_HPP
#define DESIGN_PATTERNS_FACTORY_METHOD_HPP

#include <string>

namespace DesignPatterns {
	class computer;
	class desktop;
	class laptop;
	class computer_factory;
}

/// @brief Creational pattern : factory_method 

/// @brief The base class (interface or "Product" class) 
class DesignPatterns::computer
{
public:
	virtual void run() = 0;
	virtual void stop() = 0;
};

/// @brief Concrete Product One
class DesignPatterns::laptop 
	: public DesignPatterns::computer
{
public:
	void run();
	void stop();
};

/// @brief Concrete Product Two
class DesignPatterns::desktop 
	: public DesignPatterns::computer
{
public:
	void run();
	void stop();
};

/// @brief Factory class which creates the "computer" objects.
class DesignPatterns::computer_factory
{
public:
	static computer* new_computer(const std::string& d);
};

#endif //DESIGN_PATTERNS_FACTORY_METHOD_HPP
